<template>
  <h2>当前求和为：{{ sum }}, 放大10倍后: {{ bigCounter }}</h2>
  <button @click="increment">点我+1</button>
  <button @click="decrement">点我-1</button>
  <hr>
  <img v-for="(u, index) in dogList" :key="index" :src="(u as string)">
  <!-- <span v-show="dogList.isLoading">加载中......</span><br> -->

  <h4></h4>
  <button @click="getDog">再来一只狗</button>
</template>


<script lang="ts">
export default {
  name: 'App',
}

</script>

<!-- 父组件 -->
<script lang="ts" setup>
// import { reactive, ref, onMounted } from 'vue';
import useCounter from './hooks/useCounter';
import useDog from './hooks/useDog';

let { counter: sum, bigCounter, increment, decrement } = useCounter()
let { dogList, getDog } = useDog()

</script>

<style>
.app {
  background-color: #ddd;
  box-shadow: 0 0 10px;
  border-radius: 10px;
  padding: 20px;
}

button {
  padding: 10px;
  margin: 0 5px;
}

img {
  height: 100px;
  margin-right: 5px;
}
</style>